//加载，当加载完了之后运行调用函数
window.addEventListener("load", eventWindowLoaded, false);

function eventWindowLoaded(){

	var theCanvas = document.getElementById("canvas");

	if(!theCanvas || !theCanvas.getContext){
		return;
	}

	var context = theCanvas.getContext("2d");
	var message = '';
	var textBox = document.getElementById('textBox');

	textBox.addEventListener('keyup', textBoxChanged, false);

	function drawScreen(){
		context.fillStyle = "#003366";
		context.font = "28px serif";
		context.fillText(message, 100, 100);
	}

	function textBoxChanged(e){
		var target = e.target;
		message = target.value;
		drawScreen();
	}

	drawScreen();
}
